/***********************************************************************
 * Module:  SectionConfigController.java
 * Author:  Administrator
 * Purpose: Defines the Class SectionConfigController
 ***********************************************************************/

package ishitong.configManagement.controller;

import ishitong.common.SysCodeType;
import ishitong.common.model.SysCode;
import ishitong.vehicle.common.model.Certification;
import ishitong.vehicle.common.service.biz.CertificationService;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/** @pdOid 8affe6a7-215c-4b03-a117-c096d939e66c */
@Controller
public class SectionConfigController extends ishitong.common.controller.ActionController {
   /** @pdOid 5b1e94ba-8c9a-4d01-b4e4-0dd92da86454 */
   private static final String SEC_CON_SCH = "/configManagement/sectionConfig/sectionConfigSearch";
   /** @pdOid d5ab8083-a4b6-4a11-a18d-a77b0d06f548 */
   private static final String SEC_CON_SCH_LST = "/configManagement/sectionConfig/sectionConfigSearchList";
   /** @pdOid 4042e533-0bf6-4922-9bd1-59cf5efc44d4 */
   private static final String SEC_CON_EDT = "/configManagement/sectionConfig/sectionConfigEdit";
   /** @pdOid 7a43ba4c-a0e3-4786-a75b-6161042ae010 */
   private static final String SEC_CON_VIW = "/configManagement/sectionConfig/sectionConfigView";
   /** @pdOid 87b7ce81-2e22-4774-9e28-d24763db04e5 */
   @Autowired
   private CertificationService certificationService;
   
   /** @param request
    * @exception Exception
    * @pdOid cc3da79f-cc33-49a1-8411-63a74bd9b775 */
   @RequestMapping(value = "/showSectionConfigSearch.do")
   public ModelAndView handleShowSectionConfigSearch(HttpServletRequest request) throws Exception {
   	try {
   		Map<String, Object> model = new HashMap<>();
   		// 信号灯状态
   		List<SysCode> lstSignalLampStatus = spiSysCodeService.getSysCodeListByTypeCode(SysCodeType.SIGNAL_LAMP_STATUS); 
   		model.put("lstSignalLampStatus", lstSignalLampStatus);
   
   		// 行驶方向
   		List<SysCode> lstTravelDirection = spiSysCodeService.getSysCodeListByTypeCode(SysCodeType.TRAVEL_DIRECTION);
   		model.put("lstTravelDirection", lstTravelDirection);
   
   		return new ModelAndView(SEC_CON_SCH,model);
   	} catch (Exception e) {
   		e.printStackTrace();
   	}
   	return null;
   }
   
   /** @param request
    * @pdOid 50571416-d987-4bc8-9d4f-2220e93a1a33 */
   @RequestMapping(value = "/ajaxSectionConfigSearchList.do",method = RequestMethod.POST)
   public ModelAndView handleAjaxFindSectionConfigSearchList(HttpServletRequest request) {
   	try {
   		Map<String, Object> model = new HashMap<>();
   		return new ModelAndView(SEC_CON_SCH_LST,model);
   	} catch (Exception e) {
   		e.printStackTrace();
   	}
   	return null;
   }
   
   /** @param request 
    * @param sectionConfigId 
    * @param certification
    * @exception Exception
    * @pdOid 7274fed5-2258-449c-abe1-3fb9e48abfe4 */
   @RequestMapping(value = "/ajaxShowSectionConfigEdit.do",method = RequestMethod.POST)
   public ModelAndView handleAjaxShowSectionConfigEdit(HttpServletRequest request, String sectionConfigId, Certification certification) throws Exception {
   	try {
   		Map<String, Object> model = new HashMap<>();
   		List<Certification> lstCertification = certificationService.getCertificationByCondition(certification);
   		model.put("lstCertification",lstCertification);
   		if(!StringUtils.isEmpty(sectionConfigId)){
   
   		}
   		return new ModelAndView(SEC_CON_EDT,model);
   	} catch (Exception e) {
   		e.printStackTrace();
   	}
   	return null;
   }
   
   /** @param request 
    * @param response
    * @exception Exception
    * @pdOid e7db8fa8-4096-478d-b9b7-16510ae73e68 */
   @RequestMapping(value = "/ajaxSaveSectionConfig.do",method = RequestMethod.POST)
   public void handleAjaxSaveSectionConfig(HttpServletRequest request, HttpServletResponse response) throws Exception {
   	try {
   	} catch (Exception e) {
   		e.printStackTrace();
   	}
   }
   
   /** @param request 
    * @param sectionConfigId
    * @exception Exception
    * @pdOid 3452077b-c99e-43a3-8f2a-f2552cc702bc */
   @RequestMapping(value = "/ajaxShowSectionConfigView.do", method = RequestMethod.POST)
   public ModelAndView handleAjaxShowSectionConfigView(HttpServletRequest request, String sectionConfigId) throws Exception {
   	try {
   		Map<String, Object> model = new HashMap<String, Object>();
   		if(!StringUtils.isEmpty(sectionConfigId)){
   
   		}
   		return new ModelAndView(SEC_CON_VIW,model);
   	} catch (Exception e) {
   		e.printStackTrace();
   	}
   	return null;
   }
   
   /** @param request 
    * @param sectionConfigIds 
    * @param response
    * @exception Exception
    * @pdOid b55c882c-eb1b-44ce-9bc2-418478545c66 */
   @RequestMapping(value = "/ajaxDeleteSectionConfigByIds.do",method = RequestMethod.POST)
   public void handleAjaxDeleteSectionConfigByIds(HttpServletRequest request, String sectionConfigIds, HttpServletResponse response) throws Exception {
   	try {
   	} catch (Exception e) {
   		e.printStackTrace();
   	} 	
   }

}